package com.suixinsanren.design.proxy.demo.demo01;

public class DuckProxy implements Bird {

    private final Duck duck;
    private int quackCounter = 0;

    public DuckProxy(Duck duck) {
        this.duck = duck;
    }

    @Override
    public void quack() {
        System.out.println("quack");
        quackCounter++;
    }

    @Override
    public void fly() {
        System.out.println("fly");
    }

    public int getQuackCounter() {
        return quackCounter;
    }

}
